const mkdir = require("./mkdir")
const writeFile = require("./writeFile")
const downloadImage = require("./downloadImage")
const { data } = require("../config")
const path = require("path")
// 循环数据
const setup = async () => {
  for (let index = 0; index < data.length; index++) {
    const { cm, txt, img } = data[index]
    console.log(cm,txt,img)
    // 创建目录
    await mkdir(`${index + 1}`)
    // 写入评语
    await writeFile(`${index + 1}`, `评语`, txt)
    // await writeFile(`${index + 1}`, `${cm}`, cm)
    // 写入图片
    await downloadImage(img, `${index+1}`)
  }
}
setup()